<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>ESD看板四</title>
    <link rel="stylesheet" href="../plugins/element-ui/index.css">
    <style>
        body {
            margin: auto;
            background-color: #030212;
        }
        .el-header{
            background-image: url('../images/TopImg.png'); /* 替换为你的图片路径 */
            background-size: cover; /* 背景图片覆盖整个元素 */
            background-position: center; /* 背景图片居中 */
            background-repeat: no-repeat; /* 背景图片不重复 */
        }

        .statistics {
            margin-left: 1vh;
            margin-right: 1vh;
        }

        .channelTypeNormal{
            margin: 0;
            background-color: #2cc203;
            height: 1.14vw;
        }
        .channelTypeMiss{
            margin: 0;
            background-color: #838181;
            height: 1.14vw;
        }
        .channelTypeError{
            margin: 0;
            background-color: #f73b2d;
            height: 1.14vw;
        }
        .channelTypeStandBy{
            margin: 0;
            background-color: #888621;
            height: 1.14vw;
        }
        .position{
            width: 4.8vw;
            align-items : center ;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }
        .line{
            padding-bottom: 1vh;
            border-radius: 0.5vh;
            border: 0.2vw solid #129ef0;
            box-sizing: border-box;
            position: relative;
            margin: 2vh 0.25vw 1vh;
        }
        .lineName{
            background-color: #129ef0;
            border-radius: 0.5vh;
            position: absolute;
            height: 3vh;
            width: 12%;
            top:-1.5vh;
            color: #ffffff;
            font-weight: bold;
            font-size: 0.8vw;
            left: 2%;
            line-height: 3vh;
            text-align: center;
        }
        .positionName{
            width: 4.56vw;
            font-size: 1.2vh ;
            background-color: white;
            border-bottom-left-radius: 0.3vh;
            border-bottom-right-radius: 0.3vh;
            text-align: center;
            white-space: pre-wrap;
        }
        .status{
            width: 4.56vw;
            font-size: 1.3vh ;
            color: aliceblue;
            text-align: center;
        }
        .endPoint{
            display: flex; width: 4.56vw; text-align: center;
        }
        .line .el-row{
            margin-left: 0.9vw;
            margin-right: 0.9vw;
        }
        .devices{
            /* border: solid 0.1vh #666666; */
            border-radius: 0.2vh ;
            align-content: center;
        }
        .el-tabs__item {
            color: #838181;
            font-size: 0.8vw;
        }
        .el-tabs__active-bar{
            background: transparent;
        }
        .user_skills{
            width: 85%;
            margin: auto;
        }
        /*最外层透明*/
        .el-table, .el-table__expanded-cell{
            background-color: transparent;
        }
        /* 表格内背景颜色 */
        .el-table th,
        .el-table tr,
        .el-table td {
            background-color: transparent;
        }
        /*去除底部白线*/
        .el-table::before {
            left: 0;
            bottom: 0;
            width: 100%;
            height: 0;
        }
        .el-select__tags-text {
            font-size: 16px; /* 修改为需要的字体大小 */
            color: black;
        }
        .myselect .el-input__inner {
            background-color: transparent !important;
            border: none;
        }
    </style>
</head>
<body>

<div id="app">
    <el-container style="height: 100vh;">
        <el-header height="6vh" style="display: flex;justify-content: center;align-items: center;">
            <div class="title" style="display: flex;justify-content: center;align-items: center;">
                <div style="height: 6vh;">
                    <img :src="logoPath" style="height: 6vh;">
                </div>
                <div>
                    <strong style="color: aliceblue; font-size: 4vh;">ESD实时监控系统</strong>
                </div>
            </div>
        </el-header>
        <el-main>
            <div class="time" id="showTime" style="color: aliceblue; position: absolute; right: 3vw; margin-top: -6vh; font-size: 1vw;">
                {{currentTimeStr}}
            </div>
            <el-row>
                <el-col :span="15" class="devices" id="devices">
                    <div style="width: 100%; position: absolute; margin-top: -2vh; ">
                        <span style="color: aliceblue;">选择生产线:</span>
                        <el-select class="myselect" v-model="lineIds" multiple placeholder="请选择" style="width: 35vw;">
                            <el-option
                                v-for="item in lines"
                                :key="item.lineId"
                                :label="item.lineName"
                                :value="item.lineId">
                            </el-option>
                        </el-select>
                    </div>
                    <el-divider></el-divider>
                    <div style="width: 100%;">
                        <div class="line" v-for="(lineData , lineKey) in lineDataList" :key="lineKey">
                            <div class="lineName">生产线:&nbsp;&nbsp;{{lineData.lineName}}</div>
                            <el-row :style="getRowStyle(rowKey)" v-for="(row , rowKey) in lineData.rows" :key="rowKey">
                                <el-col :span="2" v-for="(ch , chKey) in row" :key="chKey">
                                    <span class="position" @dblclick="openDialog(ch)">
                                        <span class="status">{{ch.detail}}</span>
                                        <span class="endPoint">
                                            <el-tooltip class="item" effect="dark" content="" placement="bottom">
                                                <div slot="content" style="font-size: 1.5vh;">
                                                    终端ID:&nbsp;&nbsp; {{ch.stationId}}
                                                    <br/>
                                                    通道类型:&nbsp;&nbsp; {{ch.deviceType}}
                                                    <br/>
                                                    通道编号:&nbsp;&nbsp; {{ch.channelNum}}
                                                    <br/>
                                                    通道状态:&nbsp;&nbsp; <span :style="getChannelStyle(ch.status)">{{ch.status}}</span>
                                                    <br/>
                                                    状态详情:&nbsp;&nbsp; <span :style="getChannelStyle(ch.status)">{{ch.detail}}</span>
                                                    <br v-if="ch.deviceType=='离子风扇'"/>
                                                    <span v-if="ch.deviceType=='离子风扇'">
                                                        平衡电压:&nbsp;&nbsp; {{ch.balancePower}}
                                                    </span>
                                                    <br v-if="ch.deviceType=='离子风扇'"/>
                                                    <span v-if="ch.deviceType=='离子风扇'">
                                                        放电针电压:&nbsp;&nbsp; {{ch.fdzPower}}
                                                        </span>
                                                </div>
                                                <img :src="getChannelImg(ch.channelType)"
                                                     :class="getChannelClass(ch.status)" style="border-top-left-radius: 0.3vh ; width: 4.56vw; 
                                                        border-top-right-radius: 0.3vh;">
                                            </el-tooltip>
                                        </span>
                                        <span class="positionName">{{ch.position}}</span>
                                    </span>
                                </el-col>
                            </el-row>
                        </div>
                    </div>
                </el-col>
                <el-col :span="9">
                    <div style="width: 100%; justify-content: center;align-items : center ; display: flex; flex-direction: column;">
                        <span style="color: aliceblue;font-size: 20px;">
                            设备接地阀值:&nbsp;0Ω-10Ω&nbsp;&nbsp;&nbsp;&nbsp;人体接地阀值:&nbsp;0.75MΩ-35MΩ
                            <!-- <br/>
                            台垫接地阀值:&nbsp;0.75MΩ-35MΩ -->
                        </span>
                    </div>
                    <div class="statistics" style="width: 100%;">
                        <div class="statistics-child" style="width: 100%; height: 4vh; margin-top: 5vh;text-align: center;">
                            <span style="color: aliceblue; font-size: 3vh;">ESD通道数据统计</span>
                        </div>
                        <div class="statistics-child" style="width: 100%; margin-top: 1vh; text-align: center;">
                            <el-table
                                    class="user_skills"
                                    :data="analysisList"
                                    :header-cell-style="{background: 'transparent', color: 'aliceblue' }"
                                    :cell-style="addStyle"
                            >
                                <el-table-column
                                        align="center"
                                        prop="channelName"
                                        label="通道类型">
                                </el-table-column>
                                <el-table-column
                                        align="center"
                                        prop="icon"
                                        label="图标">
                                    <template slot-scope="scope" v-if="scope.$index!=anDataLength">
                                        <img :src="scope.row.icon" style="border-radius: 2px; background-color: #838181 ;width: 20px; height: 20px;"/>
                                    </template>
                                </el-table-column>
                                <el-table-column
                                        align="center"
                                        prop="normal"
                                        label="正常">
                                </el-table-column>
                                <el-table-column
                                        align="center"
                                        prop="error"
                                        label="异常">
                                </el-table-column>
                                <el-table-column
                                        align="center"
                                        prop="miss"
                                        label="失联">
                                </el-table-column>
                                <el-table-column
                                        align="center"
                                        prop="standBy"
                                        label="待机">
                                </el-table-column>
                                <el-table-column
                                        align="center"
                                        prop="total"
                                        label="总计">
                                </el-table-column>
                            </el-table>
                        </div>
                        <div class="statistics-child" id="pieDiv" style="width: 100%; height: 28vh; margin-top: 5vh; text-align: center;">
                        </div>
                    </div>
                </el-col>
            </el-row>
        </el-main>
    </el-container>
    <div>
        <el-dialog :title="dialogTitle" :visible.sync="dzyVisible"
                   width="40%" @close="dzyCloseDialog" center>
            <el-tabs type="border-card" v-model="activeName">
                <el-tab-pane label="获取状态" name="getStatus">
                    <el-form label-position="right" label-width="100px">
                        <el-row>
                            <el-col :span="24" style="margin-bottom: 10px;">
                                <el-button style="margin-left: 10px;" type="primary" @click="handleGetStatus()">
                                    获取终端当前状态
                                </el-button>
                            </el-col>
                        </el-row>
                        <template v-if="currentStatus!=null">
                            <el-descriptions class="margin-top" :column="2"  border>
                                <el-descriptions-item>
                                    <template slot="label"> 终端类别</template>
                                    {{deviceVo.deviceTypeName}}{{currentStatus.channelType}}
                                </el-descriptions-item>
                                <el-descriptions-item>
                                    <template slot="label"> 终端ID</template>
                                    {{deviceVo.stationId}}
                                </el-descriptions-item>
                            </el-descriptions>
                            <el-descriptions class="margin-top" :column="3"  border>
                                <el-descriptions-item v-if="isOld3Channel">
                                    <template slot="label">终端当前时间</template>
                                    {{currentStatus.timeStr}}
                                </el-descriptions-item>
                                <el-descriptions-item>
                                    <template slot="label">终端信道</template>
                                    {{deviceVo.signalChannel}}
                                </el-descriptions-item>
                                <el-descriptions-item>
                                    <template slot="label">开启声音</template>
                                    {{currentStatus.soundOn}}
                                </el-descriptions-item>
                            </el-descriptions>
                            <el-descriptions class="margin-top" :column="3"  border>
                                <el-descriptions-item>
                                    <template slot="label">通道一电阻值</template>
                                    {{currentStatus.tdjddz}}Ω
                                </el-descriptions-item>
                                <el-descriptions-item>
                                    <template slot="label">通道二电阻值</template>
                                    {{currentStatus.rtjddz}}Ω
                                </el-descriptions-item>
                                <el-descriptions-item v-if="isOld3Channel">
                                    <template slot="label">通道三电阻值</template>
                                    {{currentStatus.sbjddz}}Ω
                                </el-descriptions-item>
                            </el-descriptions>
                            <el-descriptions class="margin-top" :column="3"  border>
                                <el-descriptions-item>
                                    <template slot="label">通道一有手环接入</template>
                                    {{currentStatus.channel1}}
                                </el-descriptions-item>
                                <el-descriptions-item>
                                    <template slot="label">通道二有手环接入</template>
                                    {{currentStatus.channel2}}
                                </el-descriptions-item>
                                <el-descriptions-item>
                                    <template slot="label">地线状态</template>
                                    {{currentStatus.dxzt}}
                                </el-descriptions-item>
                            </el-descriptions>
                            <el-descriptions class="margin-top" :column="4"  border>
                                <el-descriptions-item>
                                    <template slot="label">通道一状态</template>
                                    {{currentStatus.channel1Status}}
                                </el-descriptions-item>
                                <el-descriptions-item>
                                    <template slot="label">通道二状态</template>
                                    {{currentStatus.channel2Status}}
                                </el-descriptions-item>
                                <el-descriptions-item v-if="isOld3Channel">
                                    <template slot="label">通道三状态</template>
                                    {{currentStatus.channel3Status}}
                                </el-descriptions-item>
                                <el-descriptions-item>
                                    <template slot="label">地线状态</template>
                                    {{currentStatus.dxStatus}}
                                </el-descriptions-item>
                            </el-descriptions>
                        </template>
                    </el-form>
                </el-tab-pane>
                <el-tab-pane v-if="isOld3Channel" label="校正时间">
                    选择操作对象:&nbsp;&nbsp;
                    <template>
                        <el-radio v-model="line_radio" label="1">自己</el-radio>
                        <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                    </template>
                    <el-button type="primary" @click="dzyHandleTime()">确认校正时间</el-button>
                </el-tab-pane>
                <el-tab-pane label="屏幕显示">
                    选择操作对象:&nbsp;&nbsp;
                    <template>
                        <el-radio v-model="line_radio" label="1">自己</el-radio>
                        <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                    </template>
                    <el-button type="primary" @click="handleScreenOn('01')">开启</el-button>
                    <el-button type="danger" @click="handleScreenOn('00')">关闭</el-button>
                </el-tab-pane>
                <el-tab-pane v-if="isOld3Channel" label="工作时间">
                    <el-form label-position="right" label-width="100px">
                        <el-row>
                            <el-col :span="24">
                                选择操作对象:&nbsp;&nbsp;
                                <template>
                                    <el-radio v-model="line_radio" label="1">自己</el-radio>
                                    <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                                </template>
                            </el-col>
                        </el-row>
                        <el-row style="margin-top: 15px;">
                            <el-col :span="24">
                                上午:
                                <el-time-picker style="width: 120px;" placeholder="起始时间" v-model="startTime1"
                                                :format="'HH:mm:ss'"
                                                :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                </el-time-picker>
                                至
                                <el-time-picker style="width: 120px;" placeholder="结束时间" v-model="endTime1"
                                                :format="'HH:mm:ss'"
                                                :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                </el-time-picker>
                            </el-col>
                        </el-row>
                        <el-row style="margin-top: 15px;">
                            <el-col :span="24">
                                中午:
                                <el-time-picker style="width: 120px;" placeholder="起始时间" v-model="startTime2"
                                                :format="'HH:mm:ss'"
                                                :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                </el-time-picker>
                                至
                                <el-time-picker style="width: 120px;" placeholder="结束时间" v-model="endTime2"
                                                :format="'HH:mm:ss'"
                                                :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                </el-time-picker>
                            </el-col>
                        </el-row>
                        <el-row style="margin-top: 15px;">
                            <el-col :span="24">
                                晚上:
                                <el-time-picker style="width: 120px;" placeholder="起始时间" v-model="startTime3"
                                                :format="'HH:mm:ss'"
                                                :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                </el-time-picker>
                                至
                                <el-time-picker style="width: 120px;" placeholder="结束时间" v-model="endTime3"
                                                :format="'HH:mm:ss'"
                                                :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                </el-time-picker>
                            </el-col>
                        </el-row>
                        <el-row style="margin-top: 15px;">
                            <el-col :span="24">
                                <el-button type="warning" @click="handleGetWorkTime()">获取工作时间</el-button>
                                <el-button type="primary" @click="handleSetWorkTime()">确认修改</el-button>
                            </el-col>
                        </el-row>
                    </el-form>
                </el-tab-pane>
                <el-tab-pane label="终端发声" style="text-align: center;">
                    <el-button type="primary" @click="handleSound('01')">开启声音</el-button>
                    <el-button type="danger" @click="handleSound('00')">关闭声音</el-button>
                </el-tab-pane>
                <el-tab-pane label="阀值管理">
                    <el-form label-position="right" label-width="100px">
                        <el-row>
                            <el-col :span="24" style="margin-bottom: 10px;">
                                选择操作对象:&nbsp;&nbsp;
                                <template>
                                    <el-radio v-model="line_radio" label="1">自己</el-radio>
                                    <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                                </template>
                                <el-button type="warning" @click="handleGetScale()">获取阀值</el-button>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="24">
                                <span v-if="isOld3Channel">
                                    通道一:&nbsp;
                                    <el-input style="width: 150px;" placeholder=">=0" type="number"
                                              v-model="lowValue1">
                                    </el-input>
                                </span>
                                <span v-else>
                                    电阻仪阀值:&nbsp;
                                    <el-input style="width: 150px;" placeholder=">=0" type="number"
                                              v-model="lowValue1"></el-input>
                                </span>
                                至
                                <el-input placeholder="<=99" type="number" style="width: 200px;" v-model="highValue1">
                                    <template slot="append" v-if="isMOM1">Ω</template>
                                    <template slot="append" v-else="isMOM1">MΩ</template>
                                </el-input>
                                <el-button type="primary" @click="handleSetScale('11')">修改</el-button>
                            </el-col>
                        </el-row>
                        <el-row v-if="isOld3Channel" style="margin-top: 10px;">
                            <el-col :span="24">
                                通道二:&nbsp;
                                <el-input style="width: 150px;" placeholder=">=0" type="number"
                                          v-model="lowValue2"></el-input>
                                至
                                <el-input style="width: 200px;" placeholder="<=99" type="number" v-model="highValue2">
                                    <template slot="append" v-if="isMOM2">Ω</template>
                                    <template slot="append" v-else="isMOM2">MΩ</template>
                                </el-input>
                                <el-button type="primary" @click="handleSetScale('15')">修改</el-button>
                            </el-col>
                        </el-row>
                        <el-row v-if="isOld3Channel" style="margin-top: 10px;">
                            <el-col :span="24">
                                通道三:&nbsp;
                                <el-input style="width: 150px;" placeholder=">=0" type="number"
                                          v-model="lowValue3"></el-input>
                                至
                                <el-input style="width: 200px;" placeholder="<=99" type="number" v-model="highValue3">
                                    <template slot="append">Ω</template>
                                </el-input>
                                <el-button type="primary" @click="handleSetScale('19')">修改</el-button>
                            </el-col>
                        </el-row>
                    </el-form>
                </el-tab-pane>
                <el-tab-pane label="更改信道">
                    <el-form label-position="right" label-width="100px">
                        <el-row>
                            <el-col :span="24">
                                信道:
                                <el-select v-model="change_gatewayId"
                                           placeholder="请选择" style="width: 60%">
                                    <el-option v-for="item in gateways" :key="item.gatewayId" :label="showServer(item)"
                                               :value="item.gatewayId"></el-option>
                                </el-select>
                                <el-button style="margin-left: 5px;" type="primary" @click="handleXindao()">
                                    确认修改网关及信道
                                </el-button>
                            </el-col>
                        </el-row>
                    </el-form>
                </el-tab-pane>
            </el-tabs>
        </el-dialog>
    </div>
    <div>
        <el-dialog :title="dialogTitle" :visible.sync="newDzyVisible"
                   width="40%" @close="newDzyCloseDialog" center>
                <el-tabs type="border-card" v-model="activeName">
                    <el-tab-pane label="查询状态" name="getStatus">
                        <el-button type="primary" @click="getDetailsNew()">查询状态</el-button>
                        <template v-if="dzyDetailNew!=null">
                            <el-descriptions class="margin-top" :column="3" border style="margin-top: 5px;">
                                <el-descriptions-item>
                                    <template slot="label">终端类别</template>
                                    {{deviceVo.deviceTypeName}}
                                </el-descriptions-item>
                                <el-descriptions-item>
                                    <template slot="label"> 终端ID</template>
                                    {{deviceVo.stationId}}
                                </el-descriptions-item>
                                <el-descriptions-item>
                                    <template slot="label"> 信道</template>
                                    {{dzyDetailNew.signalChannel}}
                                </el-descriptions-item>
                            </el-descriptions>
                            <el-descriptions class="margin-top" :column="2" border>
                                <el-descriptions-item>
                                    <template slot="label">通道启用详情</template>
                                    {{dzyDetailNew.channelEnabled}}
                                </el-descriptions-item>
                                <el-descriptions-item>
                                    <template slot="label"> 通道模式</template>
                                    {{dzyDetailNew.channelMode}}
                                </el-descriptions-item>
                            </el-descriptions>
                            <el-descriptions class="margin-top" :column="2" border>
                                <el-descriptions-item>
                                    <template slot="label">通道电阻值</template>
                                    {{dzyDetailNew.numStr}}
                                </el-descriptions-item>
                                <el-descriptions-item>
                                    <template slot="label"> 是否有手环插入</template>
                                    {{dzyDetailNew.insertFlag}}
                                </el-descriptions-item>
                            </el-descriptions>
                            <el-descriptions class="margin-top" :column="2" border>
                                <el-descriptions-item>
                                    <template slot="label">通道状态</template>
                                    {{dzyDetailNew.compareResult}}
                                </el-descriptions-item>
                                <el-descriptions-item>
                                    <template slot="label"> 地线状态</template>
                                    {{dzyDetailNew.groundStatus}}
                                </el-descriptions-item>
                            </el-descriptions>
                        </template>    
                    </el-tab-pane>
                    <el-tab-pane label="校正时间">
                        选择操作对象:&nbsp;&nbsp;
                        <template>
                            <el-radio v-model="line_radio" label="1">自己</el-radio>
                            <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                        </template>
                        <el-button type="primary" @click="newCheckTime()">确认校正时间</el-button>
                    </el-tab-pane>
                    <el-tab-pane label="发出声音">
                        <el-button type="primary" @click="newSoundOn()">发出声音</el-button>
                    </el-tab-pane>
                    <el-tab-pane label="按键锁">
                        <el-form label-position="right" label-width="100px">
                            选择操作对象:&nbsp;&nbsp;
                            <template>
                                <el-radio v-model="line_radio" label="1">自己</el-radio>
                                <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                            </template>
                            <el-button type="primary" @click="newLockKey('00')">解锁</el-button>
                            <el-button type="warning" @click="newLockKey('01')">上锁</el-button>
                        </el-form>
                    </el-tab-pane>
                    <el-tab-pane label="通道开关">
                        <el-button type="primary" icon="el-icon-check" @click="checkChOn()">校正数据库</el-button>
                        <el-button type="warning" icon="el-icon-search" @click="searchChOn()">查询现状</el-button>
                        <br/>
                        <template v-if="channelOnDT!=null">
                            <span v-if="channelOnDT.chOn1">通道1: <el-button style="margin-top: 5px;" type="danger" @click="changeChOn(-1)">关闭</el-button></span> 
                            <span v-else="channelOnDT.chOn1">通道1: <el-button style="margin-top: 5px;" type="primary" @click="changeChOn(1)">开启</el-button></span> 
                            <span v-if="channelOnDT.chOn2">通道2: <el-button style="margin-top: 5px;" type="danger" @click="changeChOn(-2)">关闭</el-button></span> 
                            <span v-else="channelOnDT.chOn2">通道2: <el-button style="margin-top: 5px;" type="primary" @click="changeChOn(2)">开启</el-button></span> 
                        </template>
                        <br/>
                        <template v-if="channelOnDT!=null&&dialogTitle=='新版接地电阻仪（4通道）操作'">
                            <span v-if="channelOnDT.chOn3">通道3: <el-button style="margin-top: 5px;" type="danger" @click="changeChOn(-4)">关闭</el-button></span> 
                            <span v-else="channelOnDT.chOn3">通道3: <el-button style="margin-top: 5px;" type="primary" @click="changeChOn(4)">开启</el-button></span> 
                            <span v-if="channelOnDT.chOn4">通道4: <el-button style="margin-top: 5px;" type="danger" @click="changeChOn(-8)">关闭</el-button></span> 
                            <span v-else="channelOnDT.chOn4">通道4: <el-button style="margin-top: 5px;" type="primary" @click="changeChOn(8)">开启</el-button></span> 
                        </template>
                    </el-tab-pane>
                    <el-tab-pane label="通道设置">
                        <el-button type="primary" icon="el-icon-check" @click="checkChTypes()">校正数据库</el-button>
                        <el-button type="warning" icon="el-icon-search" @click="searchChTypes()">查询现状</el-button>
                        <br/>
                        <template v-if="channelTypeList!=null">
                            <span>通道1: 
                                <el-select v-model="channelTypeList.ch1" style="width: 150px; margin-top: 5px;">
                                    <el-option v-for="item in channelTypeSel" :key="item.id" :label="item.label" :value="item.id">
                                    </el-option>
                                </el-select>
                                <el-button style="margin-top: 5px;" type="primary" @click="changeChType('0A')">修改</el-button>
                            </span> 
                            <span>通道2: 
                                <el-select v-model="channelTypeList.ch2" style="width: 150px; margin-top: 5px;">
                                    <el-option v-for="item in channelTypeSel" :key="item.id" :label="item.label" :value="item.id">
                                    </el-option>
                                </el-select>
                                <el-button style="margin-top: 5px;" type="primary" @click="changeChType('0B')">修改</el-button>
                            </span> 
                        </template>
                        <br/>
                        <template v-if="channelTypeList!=null&&dialogTitle=='新版接地电阻仪（4通道）操作'">
                            <span>通道3: 
                                <el-select v-model="channelTypeList.ch3" style="width: 150px; margin-top: 5px;">
                                    <el-option v-for="item in channelTypeSel" :key="item.id" :label="item.label" :value="item.id">
                                    </el-option>
                                </el-select>
                                <el-button style="margin-top: 5px;" type="primary" @click="changeChType('0C')">修改</el-button>
                            </span> 
                            <span>通道4: 
                                <el-select v-model="channelTypeList.ch4" style="width: 150px; margin-top: 5px;">
                                    <el-option v-for="item in channelTypeSel" :key="item.id" :label="item.label" :value="item.id">
                                    </el-option>
                                </el-select>
                                <el-button style="margin-top: 5px;" type="primary" @click="changeChType('0D')">修改</el-button>
                            </span> 
                        </template>
                    </el-tab-pane>
                    <el-tab-pane label="阀值管理">
                        <el-form label-position="right" label-width="100px">
                            <el-row>
                                <el-col :span="24" style="margin-bottom: 10px;">
                                    选择操作对象:&nbsp;&nbsp;
                                    <template>
                                        <el-radio v-model="line_radio" label="1">自己</el-radio>
                                        <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                                    </template>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="24">
                                    设备:&nbsp;
                                    <el-input style="width: 150px;" placeholder=">=0" type="number"
                                                v-model="lowValue1">
                                    </el-input>
                                    至
                                    <el-input placeholder="<=99" type="number" style="width: 200px;" v-model="highValue1">
                                        <template slot="append">Ω</template>
                                    </el-input>
                                    <el-button type="warning" @click="handleGetScaleNew('1C')">获取</el-button>
                                    <el-button type="primary" @click="handleSetScaleNew('1C')" >修改</el-button>
                                </el-col>
                            </el-row>
                            <el-row style="margin-top: 10px;">
                                <el-col :span="24">
                                    台垫:&nbsp;
                                    <el-input style="width: 150px;" placeholder=">=0" type="number"
                                              v-model="lowValue2"></el-input>
                                    至
                                    <el-input style="width: 200px;" placeholder="<=99" type="number" v-model="highValue2">
                                        <template slot="append">MΩ</template>
                                    </el-input>
                                    <el-button type="warning" @click="handleGetScaleNew('20')">获取</el-button>
                                    <el-button type="primary" @click="handleSetScaleNew('20')">修改</el-button>
                                </el-col>
                            </el-row>
                            <el-row style="margin-top: 10px;">
                                <el-col :span="24">
                                    人体:&nbsp;
                                    <el-input style="width: 150px;" placeholder=">=0" type="number"
                                              v-model="lowValue3"></el-input>
                                    至
                                    <el-input style="width: 200px;" placeholder="<=99" type="number" v-model="highValue3">
                                        <template slot="append">MΩ</template>
                                    </el-input>
                                    <el-button type="warning" @click="handleGetScaleNew('24')">获取</el-button>
                                    <el-button type="primary" @click="handleSetScaleNew('24')">修改</el-button>
                                </el-col>
                            </el-row>
                        </el-form>
                    </el-tab-pane>
                    <el-tab-pane label="红外感应">
                        <el-form label-position="right" label-width="100px">
                            当前红外感应是否开启: <el-switch v-model="redClock" v-if="redClock!=null" style="margin-left: 1vw;"
                                active-color="#13ce66" inactive-color="#ff4949" disabled></el-switch>
                            <span v-if="redClock==null" style="margin-left: 1vw;">未查询</span>
                            <el-button type="primary" icon="el-icon-search" style="margin-left: 1vw;" @click="checkRedClock()">查询当前状态</el-button>
                        </el-form>
                        <el-form label-position="right" label-width="100px" style="margin-top: 5px;">
                            选择操作对象:&nbsp;&nbsp;
                            <template>
                                <el-radio v-model="line_radio" label="1">自己</el-radio>
                                <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                            </template>
                            <el-button type="danger" @click="newInfraredOn('00')">关闭</el-button>
                            <el-button type="success" @click="newInfraredOn('0F')">开启</el-button>
                        </el-form>
                    </el-tab-pane>
                    <el-tab-pane label="工作时间">
                        <el-form label-position="right" label-width="100px">
                            <el-row>
                                <el-col :span="24">
                                    选择操作对象:&nbsp;&nbsp;
                                    <template>
                                        <el-radio v-model="line_radio" label="1">自己</el-radio>
                                        <el-radio v-model="line_radio" label="2">生产线同类终端</el-radio>
                                    </template>
                                </el-col>
                            </el-row>
                            <el-row style="margin-top: 15px;">
                                <el-col :span="24">
                                    上午:
                                    <el-time-picker style="width: 120px;" placeholder="起始时间" v-model="startTime1"
                                                    :format="'HH:mm:ss'"
                                                    :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                    </el-time-picker>
                                    至
                                    <el-time-picker style="width: 120px;" placeholder="结束时间" v-model="endTime1"
                                                    :format="'HH:mm:ss'"
                                                    :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                    </el-time-picker>
                                    <el-button type="warning" @click="handleGetWorkTimeNew('28')">获取</el-button>
                                    <el-button type="primary" @click="handleSetWorkTimeNew('28')">修改</el-button>
                                </el-col>
                            </el-row>
                            <el-row style="margin-top: 15px;">
                                <el-col :span="24">
                                    下午:
                                    <el-time-picker style="width: 120px;" placeholder="起始时间" v-model="startTime2"
                                                    :format="'HH:mm:ss'"
                                                    :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                    </el-time-picker>
                                    至
                                    <el-time-picker style="width: 120px;" placeholder="结束时间" v-model="endTime2"
                                                    :format="'HH:mm:ss'"
                                                    :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                    </el-time-picker>
                                    <el-button type="warning" @click="handleGetWorkTimeNew('2E')">获取</el-button>
                                    <el-button type="primary" @click="handleSetWorkTimeNew('2E')">修改</el-button>
                                </el-col>
                            </el-row>
                            <el-row style="margin-top: 15px;">
                                <el-col :span="24">
                                    晚上:
                                    <el-time-picker style="width: 120px;" placeholder="起始时间" v-model="startTime3"
                                                    :format="'HH:mm:ss'"
                                                    :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                    </el-time-picker>
                                    至
                                    <el-time-picker style="width: 120px;" placeholder="结束时间" v-model="endTime3"
                                                    :format="'HH:mm:ss'"
                                                    :picker-options="{selectableRange: '00:00:00 - 23:59:59'}">
                                    </el-time-picker>
                                    <el-button type="warning" @click="handleGetWorkTimeNew('34')">获取</el-button>
                                    <el-button type="primary" @click="handleSetWorkTimeNew('34')">修改</el-button>
                                </el-col>
                            </el-row>
                        </el-form>
                    </el-tab-pane>
                    <el-tab-pane label="信道">
                        <el-form label-position="right" label-width="100px">
                            <el-row>
                                <el-col :span="24">
                                    信道:
                                    <el-select v-model="change_gatewayId"
                                               placeholder="请选择" style="width: 60%">
                                        <el-option v-for="item in gateways" :key="item.gatewayId" :label="showServer(item)"
                                                   :value="item.gatewayId"></el-option>
                                    </el-select>
                                    <el-button style="margin-left: 5px;" type="primary" @click="newXindao()">
                                        确认修改网关及信道
                                    </el-button>
                                </el-col>
                            </el-row>
                        </el-form>
                    </el-tab-pane>
                </el-tabs>
        </el-dialog>
    </div>
</div>
<script src="../plugins/vue/vue.js"></script>
<script src="../plugins/element-ui/index.js"></script>
<script src="../plugins/axios/axios.js"></script>
<script src="../plugins/echart/echarts.min.js"></script>
<script src="/backend/js/request.js"></script>
<script src="/backend/js/dzyApi.js"></script>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            lines: [] ,
            lineIds: [],
            checkGatewayClock: null ,
            setTimeClock: null ,
            logoPath: null ,
            currentTimeStr: null ,
            pageDataClock: null ,
            lineDataList: [] ,
            analysisList: null ,
            dzyDialogTitle: null ,
            dzyVisible: false ,
            currentStatus: null ,
            isOld3Channel: false ,
            activeName: 'getStatus' ,
            dialogTitle: null ,
            deviceVo: null ,
            line_radio: '1',
            startTime1: null,
            endTime1: null,
            startTime2: null,
            endTime2: null,
            startTime3: null,
            endTime3: null,
            lowValue1: null,
            highValue1: null,
            lowValue2: null,
            highValue2: null,
            lowValue3: null,
            highValue3: null,
            isMOM1: false ,
            isMOM2: false ,
            gateways: [] ,
            change_gatewayId: null ,
            newDzyVisible: false ,
            dzyDetailNew: null ,
            channelOnDT: null ,
            channelTypeList: null ,
            channelTypeSel: [
                { id: "01", label: 'ESD手环' },
                { id: "02", label: '台垫接地' },
                { id: "03", label: '设备接地' }
            ],
            redClock: null ,
        },
        created() {
            axios.get("/line/listAll").then((res) => {
                this.lines = res.data.data;
                for(let i = 0 ; i < res.data.data.length ; i++){
                    this.lineIds.push(this.lines[i].lineId);
                }
            });
            axios.get("/gateway/getAll").then((res) => {
                this.gateways = res.data.data;
            });
            axios.get("/line/getLogoPath").then((res) => {
                this.logoPath = res.data;
            });
            this.setTimeClock = window.setInterval(function(){
                let currentTime = new Date();
                // 格式化年份
                const year = currentTime.getFullYear();
                // 格式化月份
                const month = (currentTime.getMonth() + 1).toString().padStart(2, '0'); // 使用padStart补齐前导零
                // 格式化日期
                const day = currentTime.getDate().toString().padStart(2, '0');
                const days = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
                app.currentDateStr = year + "年" + month + "月" + day + "日  ";
                let hours = currentTime.getHours();
                let minutes = currentTime.getMinutes();
                let seconds = currentTime.getSeconds();
                hours = hours < 10 ? '0' + hours : hours;
                minutes = minutes < 10 ? '0' + minutes : minutes;
                seconds = seconds < 10 ? '0' + seconds : seconds;
                // 这里 this指向的是window, 所以要使用 app
                app.currentTimeStr = year +"/" + month +"/" + day + " " + days[currentTime.getDay()] + "  " + hours + ":" + minutes + ":" + seconds;
            }, 1000);
            this.checkGatewayClock = window.setInterval(function(){
                axios.get("/gateway/checkLineGateway?lineName=allLine").then((res) => {
                    if (res.data.code === 0) {
                        let serverIps = "" ;
                        let gatewayStatus = res.data.data;
                        let index = 0 ;
                        for (let i = 0; i < gatewayStatus.length; i++) {
                            if (!gatewayStatus[i].connected){
                                if (index === 0){
                                    serverIps = serverIps + gatewayStatus[i].serverIp;
                                }else{
                                    serverIps = serverIps + "、" + gatewayStatus[i].serverIp;
                                }
                                index++ ;
                            }
                        }
                        if (index > 0){
                            app.$message({
                                type: 'error',
                                message: "网关: " + serverIps + " 出现异常！！"
                            });
                        }
                    }
                }).catch((err) => {
                    app.$message({
                        type: 'error',
                        message: "服务器出现异常！！"
                    });
                });

            }, 3000);
            this.pageDataClock = window.setInterval(function(){
                axios.post("/device/getLinesData" , app.lineIds).then((res) => {
                    app.lineDataList = res.data.data ;
                });
                let analysisList1 = [
                    {
                        channelName: '设备接地',
                        icon: '../images/SVG/EM0.svg' ,
                        normal: 0,
                        error: 0,
                        miss: 0,
                        standBy: 0,
                        total: 0
                    },
                    {
                        channelName: '台垫接地',
                        icon: '../images/SVG/RR0.svg' ,
                        normal: 0,
                        error: 0,
                        miss: 0,
                        standBy: 0,
                        total: 0
                    },
                    {
                        channelName: 'ESD手环',
                        icon: '../images/SVG/WH0.svg' ,
                        normal: 0,
                        error: 0,
                        miss: 0,
                        standBy: 0,
                        total: 0
                    },
                    {
                        channelName: '离子风扇',
                        icon: '../images/SVG/EN0.svg' ,
                        normal: 0,
                        error: 0,
                        miss: 0,
                        standBy: 0,
                        total: 0
                    },
                    {
                        channelName: '温度计',
                        icon: '../images/SVG/TE1.svg' ,
                        normal: 0,
                        error: 0,
                        miss: 0,
                        standBy: 0,
                        total: 0
                    },
                    {
                        channelName: '湿度计',
                        icon: '../images/SVG/HU0.svg' ,
                        normal: 0,
                        error: 0,
                        miss: 0,
                        standBy: 0,
                        total: 0
                    },
                    {
                        channelName: '尘埃粒子',
                        icon: '../images/SVG/CL1.svg' ,
                        normal: 0,
                        error: 0,
                        miss: 0,
                        standBy: 0,
                        total: 0
                    },
                    {
                        channelName: '总计',
                        icon: '' ,
                        normal: 0,
                        error: 0,
                        miss: 0,
                        standBy: 0,
                        total: 0
                    }
                ];
                for (let i = 0; i < app.lineDataList.length; i++) {
                    let lineData = app.lineDataList[i] ;
                    for (let j = 0; j < lineData.rows.length; j++) {
                        let row = lineData.rows[j] ;
                        for (let k = 0; k < row.length; k++) {
                            let channel = row[k] ;
                            if(channel.channelType === '设备接地'){
                                if (channel.status === '正常'){
                                    analysisList1[0].normal ++ ;
                                    analysisList1[7].normal ++ ;
                                }else if (channel.status === '异常'){
                                    analysisList1[0].error ++ ;
                                    analysisList1[7].error ++ ;
                                }else if (channel.status === '待机'){
                                    analysisList1[0].standBy ++ ;
                                    analysisList1[7].standBy ++ ;
                                }else if (channel.status === '失联'){
                                    analysisList1[0].miss ++ ;
                                    analysisList1[7].miss ++ ;
                                }
                                analysisList1[0].total ++ ;
                                analysisList1[7].total ++ ;
                            }else if(channel.channelType === '台垫接地'){
                                if (channel.status === '正常'){
                                    analysisList1[1].normal ++ ;
                                    analysisList1[7].normal ++ ;
                                }else if (channel.status === '异常'){
                                    analysisList1[1].error ++ ;
                                    analysisList1[7].error ++ ;
                                }else if (channel.status === '待机'){
                                    analysisList1[1].standBy ++ ;
                                    analysisList1[7].standBy ++ ;
                                }else if (channel.status === '失联'){
                                    analysisList1[1].miss ++ ;
                                    analysisList1[7].miss ++ ;
                                }
                                analysisList1[1].total ++ ;
                                analysisList1[7].total ++ ;
                            }else if(channel.channelType === 'ESD手环'){
                                if (channel.status === '正常'){
                                    analysisList1[2].normal ++ ;
                                    analysisList1[7].normal ++ ;
                                }else if (channel.status === '异常'){
                                    analysisList1[2].error ++ ;
                                    analysisList1[7].error ++ ;
                                }else if (channel.status === '待机'){
                                    analysisList1[2].standBy ++ ;
                                    analysisList1[7].standBy ++ ;
                                }else if (channel.status === '失联'){
                                    analysisList1[2].miss ++ ;
                                    analysisList1[7].miss ++ ;
                                }
                                analysisList1[2].total ++ ;
                                analysisList1[7].total ++ ;
                            }else if(channel.channelType === '离子风扇'){
                                if (channel.status === '正常'){
                                    analysisList1[3].normal ++ ;
                                    analysisList1[7].normal ++ ;
                                }else if (channel.status === '异常'){
                                    analysisList1[3].error ++ ;
                                    analysisList1[7].error ++ ;
                                }else if (channel.status === '待机'){
                                    analysisList1[3].standBy ++ ;
                                    analysisList1[7].standBy ++ ;
                                }else if (channel.status === '失联'){
                                    analysisList1[3].miss ++ ;
                                    analysisList1[7].miss ++ ;
                                }
                                analysisList1[3].total ++ ;
                                analysisList1[7].total ++ ;
                            }else if(channel.channelType === '温度计'){
                                if (channel.status === '正常'){
                                    analysisList1[4].normal ++ ;
                                    analysisList1[7].normal ++ ;
                                }else if (channel.status === '异常'){
                                    analysisList1[4].error ++ ;
                                    analysisList1[7].error ++ ;
                                }else if (channel.status === '待机'){
                                    analysisList1[4].standBy ++ ;
                                    analysisList1[7].standBy ++ ;
                                }else if (channel.status === '失联'){
                                    analysisList1[4].miss ++ ;
                                    analysisList1[7].miss ++ ;
                                }
                                analysisList1[4].total ++ ;
                                analysisList1[7].total ++ ;
                            }else if(channel.channelType === '湿度计'){
                                if (channel.status === '正常'){
                                    analysisList1[5].normal ++ ;
                                    analysisList1[7].normal ++ ;
                                }else if (channel.status === '异常'){
                                    analysisList1[5].error ++ ;
                                    analysisList1[7].error ++ ;
                                }else if (channel.status === '待机'){
                                    analysisList1[5].standBy ++ ;
                                    analysisList1[7].standBy ++ ;
                                }else if (channel.status === '失联'){
                                    analysisList1[5].miss ++ ;
                                    analysisList1[7].miss ++ ;
                                }
                                analysisList1[5].total ++ ;
                                analysisList1[7].total ++ ;
                            }else if(channel.channelType === '尘埃粒子'){
                                if (channel.status === '正常'){
                                    analysisList1[6].normal ++ ;
                                    analysisList1[7].normal ++ ;
                                }else if (channel.status === '异常'){
                                    analysisList1[6].error ++ ;
                                    analysisList1[7].error ++ ;
                                }else if (channel.status === '待机'){
                                    analysisList1[6].standBy ++ ;
                                    analysisList1[7].standBy ++ ;
                                }else if (channel.status === '失联'){
                                    analysisList1[6].miss ++ ;
                                    analysisList1[7].miss ++ ;
                                }
                                analysisList1[6].total ++ ;
                                analysisList1[7].total ++ ;
                            }
                        }
                    }
                }
                app.analysisList = [] ;
                for(let i = 0; i < analysisList1.length; i++){
                    if(analysisList1[i].total!=0){
                        app.analysisList.push(analysisList1[i]) ;
                    }
                }
                let size1 = app.analysisList.length - 1 ;
                app.anDataLength = size1 ;
                if(size1!=-1){
                    let ecDemo = echarts.init(document.getElementById("pieDiv"));
                    let pieData = [
                        {
                            name: '正常',
                            value: app.analysisList[size1].normal,
                            itemStyle: {color: '#2cc203'}
                        },
                        {
                            name: '异常',
                            value: app.analysisList[size1].error,
                            itemStyle: {color: '#f82d1f'}
                        },
                        {
                            name: '失联',
                            value: app.analysisList[size1].miss,
                            itemStyle: {color: '#5c5a5a'}
                        },
                        {
                            name: '待机',
                            value: app.analysisList[size1].standBy,
                            itemStyle: {color: '#888621'}
                        }
                    ];
                    let option = {
                        series : [
                            {
                                type : 'pie',
                                data : pieData ,
                                label: {
                                    show : true ,
                                    color: 'aliceblue',
                                    formatter: function (args) {
                                        return args.data.name + ': ' + args.percent + '%';
                                    }
                                },
                                roseType : 'radius'
                            }
                        ]
                    }
                    ecDemo.setOption(option);
                }
            }, 3000);

        },
        watch: {
            activeName: function (newValue, oldValue) {
                this.line_radio = "1";
                this.redClock = null ;
            }
        },
        mounted(){
            
        },
        methods: {
            getChannelStyle(status){
                if (status === '失联'){
                    return {
                        'color': '#838181'
                    } ;
                }else if (status === '正常'){
                    return {
                        "color": '#2cc203'
                    } ;
                }else if (status === '异常'){
                    return {
                        "color": '#f73b2d'
                    } ;
                }else{
                    return {
                        "color": '#888621'
                    } ;
                }
            },
            getChannelClass(status){
                if (status === '失联'){
                    return "channelTypeMiss" ;
                }else if (status === '正常'){
                    return "channelTypeNormal" ;
                }else if (status === '异常'){
                    return "channelTypeError" ;
                }else{
                    return "channelTypeStandBy" ;
                }
            },
            getChannelImg(channelTypeName){
                if (channelTypeName === 'ESD手环') {
                    return "../images/SVG/WH0.svg";
                } else if (channelTypeName === '设备接地') {
                    return "../images/SVG/EM0.svg";
                } else if (channelTypeName === '台垫接地') {
                    return "../images/SVG/RR0.svg";
                } else if (channelTypeName === '离子风扇'){
                    return "../images/SVG/EN0.svg";
                }else if (channelTypeName === '温度计'){
                    return "../images/SVG/TE1.svg";
                }else if (channelTypeName === '湿度计'){
                    return "../images/SVG/HU0.svg";
                }else if (channelTypeName === '尘埃粒子'){
                    return "../images/SVG/CL1.svg";
                }
            },
            getRowStyle(index){
                if(index === 0){
                    return {
                        'margin-top': '2vh' ,
                    }
                }else{
                    return {
                        'margin-top': '0.5vh' ,
                    }
                }
            },
            addStyle({row,column,rowIndex,columnIndex}){
                if(columnIndex === 1){
                    return ' color: #838181';
                }
                if(columnIndex === 2){
                    return ' color: #2cc203';
                }
                if(columnIndex === 3){
                    return ' color: #f82d1f';
                }
                if(columnIndex === 4){
                    return ' color: #969a9b';
                }
                if(columnIndex === 5){
                    return ' color: #888621';
                }
                if(columnIndex === 6){
                    return ' color: #969a9b';
                }
            },
            openDialog(ch){
                axios.get("/device/getVoById/" + ch.deviceId).then((res) => {
                    this.dialogTitle = ch.deviceType + "操作" ;
                    if(res.data.data == undefined){
                        this.$message.error("您尚未登录！请先登录，再进行操作！！");
                    }else if(ch.status === '失联'){
                        this.$message.error("终端目前为失联状态，无法进行控制!!");
                    }else{
                        if(res.data.code === 0 ){
                            this.deviceVo = res.data.data ;
                            this.isMOM1 = (this.deviceVo.channelTypes[0].channelTypeName=='设备接地') ;
                            this.isMOM2 = (this.deviceVo.channelTypes[1].channelTypeName=='设备接地') ;
                            this.change_gatewayId = this.deviceVo.gatewayId ;
                            console.log(ch.deviceType) ;
                            if(ch.deviceType === '接地电阻仪（2通道）'){
                                this.isOld3Channel = false ;
                                this.dzyVisible = true ;
                            }else if(ch.deviceType === '接地电阻仪（3通道）'){
                                this.isOld3Channel = true ;
                                this.dzyVisible = true ;
                            }else if(ch.deviceType === '新版接地电阻仪（2通道）' ||ch.deviceType === '新版接地电阻仪（4通道）'){
                                this.newDzyVisible = true ;
                            }
                        }else{
                            this.$message.error(res.data.msg);
                        }
                    }
                } );
            },
            // ================ 旧版接地电阻仪 开始 =================
            dzyCloseDialog(){
                this.currentStatus = null ;
                this.activeName = 'getStatus' ;
                this.line_radio = '1' ;
                this.startTime1 = null ;
                this.endTime1 = null;
                this.startTime2 = null;
                this.endTime2 = null;
                this.startTime3 = null;
                this.endTime3 = null;
                this.lowValue1 = null;
                this.highValue1 = null;
                this.lowValue2 = null;
                this.highValue2 = null;
                this.lowValue3 = null;
                this.highValue3 = null;
                this.isMOM1 = false ;
                this.isMOM2 = false ;
            },
            handleGetStatus(){
                $axios({
                    url: '/resistance/search/old/getDetails',
                    method: 'post',
                    data: this.deviceVo
                }).then((res) => {
                    if (res.code === 0) {
                        this.$message({ type: 'success', message: res.msg });
                        this.currentStatus = res.data;
                    } else {
                        this.$message.error(res.msg);
                    }
                });
            },
            dzyHandleTime() {
                if (this.line_radio === "1") {
                    this.$confirm("你确定要校正终端 " + this.deviceVo.stationId + "的时间吗？", "提示", {//确认框
                        type: 'warning'
                    }).then(() => {
                        handleTime1(this.deviceVo) ;
                    }).catch(() => {
                        this.$message({ type: 'info', message: '操作已取消' });
                    });
                } else {
                    this.$confirm("你确定要校正生产线 " + this.deviceVo.line + "所有 " + this.deviceVo.deviceTypeName
                        + " 的时间吗？", "提示", {//确认框
                        type: 'warning'
                    }).then(() => {
                        $axios({
                            url: "/device/getByLineAndType?deviceType=" + this.deviceVo.deviceTypeName + "&lineName=" + this.deviceVo.line,
                            method: 'get',
                            params: null
                        }).then((res) => {
                            if (res.code === 0) {
                                let deviceVoss = res.data;
                                for (let i = 0; i < deviceVoss.length; i++) {
                                    handleTime1(deviceVoss[i]) ;
                                }
                            } else {
                                this.$message.error("查询失败！！");
                            }
                        });
                    }).catch(() => {
                        this.$message({type: 'info', message: '操作已取消'});
                    });
                }
            },
            handleScreenOn(status){
                let op = '' ;
                if (status === "00") {
                    op = "关闭";
                } else if (status === "01") {
                    op = "开启";
                }
                if (this.line_radio === "1") {
                    this.$confirm("你确定要" + op + "终端 " + this.deviceVo.stationId + "的屏幕吗？", "提示", {//确认框
                        type: 'warning'
                    }).then(() => {
                        handleScreenOn1(status,this.deviceVo) ;
                    }).catch(() => {
                        this.$message({ type: 'info', message: '操作已取消' });
                    });
                } else {
                    this.$confirm("你确定要" + op + "生产线 " + this.deviceVo.line + "所有 " + this.deviceVo.deviceTypeName
                        + " 的屏幕吗？", "提示", {//确认框
                        type: 'warning'
                    }).then(() => {
                        $axios({
                            url: "/device/getByLineAndType?deviceType=" + this.deviceVo.deviceTypeName + "&lineName=" + this.deviceVo.line,
                            method: 'get',
                            params: null
                        }).then((res) => {
                            if (res.code === 0) {
                                let deviceVoss = res.data;
                                for (let i = 0; i < deviceVoss.length; i++) {
                                    handleScreenOn1(status,deviceVoss[i]) ;
                                }
                            } else {
                                this.$message.error("查询失败！！");
                            }
                        });
                    }).catch(() => {
                        this.$message({type: 'info', message: '操作已取消'});
                    });
                }
            },
            handleGetWorkTime() {
                $axios({
                    url: "/resistance/search/old/getWorkTime",
                    method: 'post',
                    data: this.deviceVo
                }).then((res) => {
                    if (res.code === 0) {
                        this.$message({ type: 'success', message: "获取工作时间成功！！" });
                        this.startTime1 = new Date("2016-09-10T" + res.data.tdkssj);
                        this.startTime2 = new Date("2016-09-10T" + res.data.rtkssj);
                        this.startTime3 = new Date("2016-09-10T" + res.data.sbkssj);
                        this.endTime1 = new Date("2016-09-10T" + res.data.tdjssj);
                        this.endTime2 = new Date("2016-09-10T" + res.data.rtjssj);
                        this.endTime3 = new Date("2016-09-10T" + res.data.sbjssj);
                    } else {
                        this.$message.error(res.msg);
                    }
                });
            },
            handleSetWorkTime() {
                if (this.startTime1 === null
                    || this.startTime2 === null
                    || this.startTime3 === null
                    || this.endTime1 === null
                    || this.endTime2 === null
                    || this.endTime3 === null
                    || this.endTime1 < this.startTime1
                    || this.endTime2 < this.startTime2
                    || this.endTime3 < this.startTime3
                ) {
                    this.$message({ type: 'error', message: '时间设置有误！！' });
                    return;
                }
                if (this.line_radio === "1") {
                    this.$confirm("你确定要设置终端 " + this.deviceVo.stationId + "的工作时间吗？", "提示", {//确认框
                        type: 'warning'
                    }).then(() => {
                        handleSetWorkTime1(this.deviceVo)
                    }).catch(() => {
                        this.$message({ type: 'info', message: '操作已取消' });
                    });
                } else {
                    this.$confirm("你确定要设置生产线 " + this.deviceVo.line + "所有" + this.deviceVo.deviceTypeName + "的工作时间吗？", "提示", {//确认框
                        type: 'warning'
                    }).then(() => {
                        $axios({
                            url: "/device/getByLineAndType?deviceType=" + this.deviceVo.deviceTypeName + "&lineName=" + this.deviceVo.line,
                            method: 'get',
                            params: null
                        }).then((res) => {
                            if (res.code === 0) {
                                let deviceVoss = res.data;
                                for (let i = 0; i < deviceVoss.length; i++) {
                                    handleSetWorkTime1(deviceVoss[i]);
                                }
                            } else {
                                this.$message.error("查询失败！！");
                            }
                        });
                    }).catch(() => {
                        this.$message({ type: 'info', message: '操作已取消' });
                    });
                }
            },
            handleSound(status) {
                let ss = "";
                if (status === "00") {
                    ss = "打开";
                } else if (status === "01") {
                    ss = "关闭";
                }
                this.$confirm("你确定要" + ss + "终端 " + this.deviceVo.stationId + "的声音吗？", "提示", {//确认框
                    type: 'warning'
                }).then(() => {
                    $axios({
                        url: "/resistance/operation/old/soundOn/" + status,
                        method: 'post',
                        data: this.deviceVo
                    }).then((res) => {
                        if (res.code === 0) {
                            this.$message({ type: 'success', message: res.msg });
                        } else {
                            this.$message.error(res.msg);
                        }
                    })
                }).catch(() => {
                    this.$message({type: 'info',message: '操作已取消'});
                });
            },
            handleGetScale() {
                $axios({
                    url: '/resistance/search/old/getScale',
                    method: 'post',
                    data: this.deviceVo
                }).then((res) => {
                    if (res.code === 0) {
                        this.$message({ type: 'success', message: res.msg });
                        this.lowValue1 = res.data.tdxx;
                        this.highValue1 = res.data.tdsx;
                        this.lowValue2 = res.data.rtxx;
                        this.highValue2 = res.data.rtsx;
                        this.lowValue3 = res.data.sbxx;
                        this.highValue3 = res.data.sbsx;
                    } else {
                        this.$message.error(res.msg);
                    }
                });
            },
            handleSetScale(channel) {
                if (channel === "11" &&
                    (this.lowValue1 < 0 || this.lowValue1 > 99
                        || this.highValue1 <= 0 || this.highValue1 > 99.99 || (this.lowValue1 >= this.highValue1)
                        || this.lowValue1 === null || this.highValue1 === null
                    )
                ) {
                    this.$message({ type: 'error',  message: '阀值设置有误！！' });
                    return;
                } else if (channel === "15" &&
                    (this.lowValue2 < 0 || this.lowValue2 > 99
                        || this.highValue2 <= 0 || this.highValue2 > 99.99 || (this.lowValue2 >= this.highValue2)
                        || this.lowValue2 === null || this.highValue2 === null
                    )
                ) {
                    this.$message({ type: 'error', message: '阀值设置有误！！' });
                    return;
                } else if (channel === "19" &&
                    (this.lowValue3 < 0 || this.lowValue3 > 99
                        || this.highValue3 <= 0 || this.highValue3 > 99.99 || (this.lowValue3 >= this.highValue3)
                        || this.lowValue3 === null || this.highValue3 === null
                    )
                ) {
                    this.$message({type: 'error',message: '阀值设置有误！！'});
                    return;
                }
                let scaleStr;
                if (channel === "11") {
                    let low = this.lowValue1 * 100;
                    let high = this.highValue1 * 100;
                    scaleStr = low + "-" + high;
                } else if (channel === "15") {
                    let low = this.lowValue2 * 100;
                    let high = this.highValue2 * 100;
                    scaleStr = low + "-" + high;
                } else {
                    let low = this.lowValue3 * 100;
                    let high = this.highValue3 * 100;
                    scaleStr = low + "-" + high;
                }
                if (this.line_radio === "2") {
                    this.$confirm("你确定要设置生产线" + this.deviceVo.line + "所有" + this.deviceVo.deviceTypeName
                        + "的电阻阀值吗？", "提示", {//确认框
                        type: 'warning'
                    }).then(() => {
                        $axios({
                            url: "/device/getByLineAndType?deviceType=" + this.deviceVo.deviceTypeName + "&lineName=" + this.deviceVo.line,
                            method: 'get',
                            params: null
                        }).then((res) => {
                            if (res.code === 0) {
                                let deviceVoss = res.data;
                                for (let i = 0; i < deviceVoss.length; i++) {
                                    handleSetScale1(channel , scaleStr , deviceVoss[i])
                                }
                            } else {
                                this.$message.error("查询失败！！");
                            }
                        });
                    }).catch(() => {
                        this.$message({type: 'info',message: '操作已取消'});
                    });
                } else {
                    this.$confirm("你确定要设置终端" + this.deviceVo.stationId
                        + "的电阻阀值吗？", "提示", {//确认框
                        type: 'warning'
                    }).then(() => {
                        handleSetScale1(channel , scaleStr , this.deviceVo)
                    }).catch(() => {
                        this.$message({type: 'info',message: '操作已取消'});
                    });
                }
            },
            // 处理信道的请求方法
            handleXindao() {
                this.$confirm("你确定要更改终端 " + this.deviceVo.stationId + "的信道吗？", "提示", {//确认框
                    type: 'warning'
                }).then(() => {
                    $axios({
                        url: "/resistance/operation/old/setSignalChannel/" + this.change_gatewayId,
                        method: 'post',
                        data: this.deviceVo
                    }).then((res) => {
                        if (res.code === 0) {
                            this.$message({ type: 'success', message: res.msg });
                            this.dzyVisible = false;
                        } else {
                            this.$message.error(res.msg);
                        }
                    });
                }).catch(() => {
                    this.$message({ type: 'info', message: '操作已取消' });
                });
            },
            // ================ 旧版接地电阻仪 结束 =================

            // ================ 新版版接地电阻仪 开始 =================
            newDzyCloseDialog(){
                this.newDzyVisible = false ;  
                this.dzyDetailNew = null ;
                this.activeName = 'getStatus' ;
                this.line_radio = '1' ;
                this.channelOnDT = null ;
                this.channelTypeList = null ;
                this.lowValue1 = null;
                this.highValue1 = null;
                this.lowValue2 = null;
                this.highValue2 = null;
                this.lowValue3 = null;
                this.highValue3 = null;
                this.startTime1 = null ;
                this.endTime1 = null;
                this.startTime2 = null;
                this.endTime2 = null;
                this.startTime3 = null;
                this.endTime3 = null;
                this.redClock = null ;
            },
            getDetailsNew(){
                $axios({
                    url: "/resistance/search/getDetails",
                    method: 'post',
                    data: this.deviceVo
                }).then((res) => {
                    if (res.code === 0) {
                        this.dzyDetailNew = res.data ;
                        this.$message({ type: 'success', message: res.msg });
                    } else {
                        this.$message.error(res.msg);
                    }
                })
            },
            newCheckTime(){
                if (this.line_radio === "1") {
                    this.$confirm("你确定要校正终端 " + this.deviceVo.stationId + "的时间吗？", "提示", {//确认框
                        type: 'warning'
                    }).then(() => {
                        handleTime2(this.deviceVo) ;
                    }).catch(() => {
                        this.$message({ type: 'info', message: '操作已取消' });
                    });
                } else {
                    this.$confirm("你确定要校正生产线 " + this.deviceVo.line + "所有 " + this.deviceVo.deviceTypeName
                        + " 的时间吗？", "提示", {//确认框
                        type: 'warning'
                    }).then(() => {
                        $axios({
                            url: "/device/getByLineAndType?deviceType=" + this.deviceVo.deviceTypeName + "&lineName=" + this.deviceVo.line,
                            method: 'get',
                            params: null
                        }).then((res) => {
                            if (res.code === 0) {
                                let deviceVoss = res.data;
                                for (let i = 0; i < deviceVoss.length; i++) {
                                    handleTime2(deviceVoss[i]) ;
                                }
                            } else {
                                this.$message.error("查询失败！！");
                            }
                        });
                    }).catch(() => {
                        this.$message({type: 'info', message: '操作已取消'});
                    });
                }
            },
            newSoundOn(){
                $axios({
                    url: "/resistance/operation/soundOn/01",
                    method: 'post',
                    data: this.deviceVo
                }).then((res) => {
                    if (res.code === 0) {
                        this.$message({ type: 'success', message: res.msg });
                    } else {
                        this.$message.error(res.msg);
                    }
                });
            },
            newLockKey(status){
                if (this.line_radio === "1") {
                    this.$confirm("你确定要锁定或解锁终端 " + this.deviceVo.stationId + "的按键吗？", "提示", {//确认框
                        type: 'warning'
                    }).then(() => {
                        newLockKey1(this.deviceVo , status) ;
                    }).catch(() => {
                        this.$message({ type: 'info', message: '操作已取消' });
                    });
                } else {
                    this.$confirm("你确定要锁定或解锁生产线 " + this.deviceVo.line + "所有 " + this.deviceVo.deviceTypeName
                        + " 的按键吗？", "提示", {//确认框
                        type: 'warning'
                    }).then(() => {
                        $axios({
                            url: "/device/getByLineAndType?deviceType=" + this.deviceVo.deviceTypeName + "&lineName=" + this.deviceVo.line,
                            method: 'get',
                            params: null
                        }).then((res) => {
                            if (res.code === 0) {
                                let deviceVoss = res.data;
                                for (let i = 0; i < deviceVoss.length; i++) {
                                    newLockKey1(deviceVoss[i] , status) ;
                                }
                            } else {
                                this.$message.error("查询失败！！");
                            }
                        });
                    }).catch(() => {
                        this.$message({type: 'info', message: '操作已取消'});
                    });
                }
            },
            checkChOn(){
                $axios({
                    url: "/resistance/search/checkChOn",
                    method: 'post',
                    data: this.deviceVo
                }).then((res) => {
                    if (res.code === 0) {
                        this.$message({ type: 'success', message: res.msg });
                    } else {
                        this.$message.error(res.msg);
                    }
                })
            },
            searchChOn(){
                $axios({
                    url: "/resistance/search/searchChannelEnabled",
                    method: 'post',
                    data: this.deviceVo
                }).then((res) => {
                    if (res.code === 0) {
                        this.channelOnDT = res.data ;
                        this.$message({ type: 'success', message: res.msg });
                    } else {
                        this.$message.error(res.msg);
                    }
                })
            },
            changeChOn(value){
                let num = this.channelOnDT.nowNum + value ;
                $axios({
                    url: "/resistance/operation/channelOn/" + num ,
                    method: 'post',
                    data: this.deviceVo
                }).then((res) => {
                    if (res.code === 0) {
                        axios.post("/resistance/search/searchChannelEnabled", this.deviceVo).then((res) => {
                            if (res.data.code === 0) {
                                this.channelOnDT = res.data.data ;
                            } else {
                                this.$message.error(res.data.msg);
                            }
                        });
                        this.$message({ type:'success', message: res.msg });
                    } else {
                        this.$message.error(res.msg);
                    }
                })
            },
            searchChTypes(){
                $axios({
                    url: "/resistance/search/searchChannelType",
                    method: 'post',
                    data: this.deviceVo
                }).then((res) => {
                    if (res.code === 0) {
                        this.channelTypeList = res.data ;
                        this.$message({ type:'success', message: res.msg });
                    } else {
                        this.$message.error(res.msg);
                    }
                })
            },
            checkChTypes(){
                $axios({
                    url: "/resistance/search/checkChTypes",
                    method: 'post',
                    data: this.deviceVo
                }).then((res) => {
                    if (res.code === 0) {
                        this.$message({ type:'success', message: res.msg });
                    } else {
                        this.$message.error(res.msg);
                    }
                })
            },
            changeChType(ch){
                let chType ;
                if(ch == "0A"){
                    chType = this.channelTypeList.ch1;
                }else if(ch == "0B"){
                    chType = this.channelTypeList.ch2;
                }else if(ch == "0C"){
                    chType = this.channelTypeList.ch3;
                }else{
                    chType = this.channelTypeList.ch4;
                }
                $axios({
                    url: "/resistance/operation/setChannelType/" + chType + "/" + ch,
                    method: 'post',
                    data: this.deviceVo
                }).then((res) => {
                    if (res.code === 0) {
                        this.$message({ type:'success', message: res.msg });
                    } else {
                        this.$message.error(res.msg);
                    }
                })
            },
            handleSetScaleNew(channelType) {
                if (channelType === "1C" &&
                    (this.lowValue1 < 0 || this.lowValue1 > 99
                        || this.highValue1 <= 0 || this.highValue1 > 100 || (this.lowValue1 >= this.highValue1)
                        || this.lowValue1 === null || this.highValue1 === null
                    )
                ) {
                    this.$message({ type: 'error',  message: '设备阀值设置有误！！' });
                    return;
                } else if (channelType === "20" &&
                    (this.lowValue2 < 0 || this.lowValue2 > 99
                        || this.highValue2 <= 0 || this.highValue2 > 100 || (this.lowValue2 >= this.highValue2)
                        || this.lowValue2 === null || this.highValue2 === null
                    )
                ) {
                    this.$message({ type: 'error', message: '台垫阀值设置有误！！' });
                    return;
                } else if (channelType === "24" &&
                    (this.lowValue3 < 0 || this.lowValue3 > 99
                        || this.highValue3 <= 0 || this.highValue3 > 100 || (this.lowValue3 >= this.highValue3)
                        || this.lowValue3 === null || this.highValue3 === null
                    )
                ) {
                    this.$message({type: 'error',message: '人体阀值设置有误！！'});
                    return;
                }
                let scaleStr;
                if (channelType === "1C") {
                    let low = this.lowValue1 * 10;
                    let high = this.highValue1 * 10;
                    scaleStr = low + "-" + high;
                } else if (channelType === "20") {
                    let low = this.lowValue2 * 10;
                    let high = this.highValue2 * 10;
                    scaleStr = low + "-" + high;
                } else {
                    let low = this.lowValue3 * 10;
                    let high = this.highValue3 * 10;
                    scaleStr = low + "-" + high;
                }
                if (this.line_radio === "2") {
                    this.$confirm("你确定要设置生产线" + this.deviceVo.line + "所有" + this.deviceVo.deviceTypeName
                        + "的电阻阀值吗？", "提示", {//确认框
                        type: 'warning'
                    }).then(() => {
                        $axios({
                            url: "/device/getByLineAndType?deviceType=" + this.deviceVo.deviceTypeName + "&lineName=" + this.deviceVo.line,
                            method: 'get',
                            params: null
                        }).then((res) => {
                            if (res.code === 0) {
                                let deviceVoss = res.data;
                                for (let i = 0; i < deviceVoss.length; i++) {
                                    handleSetScale2(channelType , scaleStr , deviceVoss[i])
                                }
                            } else {
                                this.$message.error("查询失败！！");
                            }
                        });
                    }).catch(() => {
                        this.$message({type: 'info',message: '操作已取消'});
                    });
                } else {
                    this.$confirm("你确定要设置终端" + this.deviceVo.stationId
                        + "的电阻阀值吗？", "提示", {//确认框
                        type: 'warning'
                    }).then(() => {
                        handleSetScale2(channelType , scaleStr , this.deviceVo)
                    }).catch(() => {
                        this.$message({type: 'info',message: '操作已取消'});
                    });
                }
            },
            handleGetScaleNew(channelType) {
                $axios({
                    url: "/resistance/search/getScale/" + channelType,
                    method: 'post',
                    data: this.deviceVo
                }).then((res) => {
                    if (res.code === 0) {
                        this.$message({type: 'success',message: res.msg});
                        if(channelType == "1C"){
                            this.lowValue1 = res.data.data.lowerNum;
                            this.highValue1 = res.data.data.upperNum;
                        }else if (channelType == "20"){
                            this.lowValue2 = res.data.data.lowerNum;
                            this.highValue2 = res.data.data.upperNum;
                        }else{
                            this.lowValue3 = res.data.data.lowerNum;
                            this.highValue3 = res.data.data.upperNum;
                        }
                    } else {
                        this.$message.error(res.msg);
                    }
                })
            },
            checkRedClock(){
                $axios({
                    url: "/resistance/search/checkRedClock",
                    method: 'post',
                    data: this.deviceVo
                }).then((res) => {
                    if (res.code === 0) {
                        this.redClock = res.data ;
                    } else {
                        this.$message.error("查询失败！！");
                    }
                });
            },
            newInfraredOn(status){
                if (this.line_radio === "1") {
                    this.$confirm("你确定要开启或关闭 " + this.deviceVo.stationId + "的红外感应功能吗？", "提示", {//确认框
                        type: 'warning'
                    }).then(() => {
                        newInfraredOn1(this.deviceVo , status) ;
                    }).catch(() => {
                        this.$message({ type: 'info', message: '操作已取消' });
                    });
                } else {
                    this.$confirm("你确定要开启或关闭生产线 " + this.deviceVo.line + "所有 " + this.deviceVo.deviceTypeName
                        + " 的红外感应功能吗？", "提示", {//确认框
                        type: 'warning'
                    }).then(() => {
                        $axios({
                            url: "/device/getByLineAndType?deviceType=" + this.deviceVo.deviceTypeName + "&lineName=" + this.deviceVo.line,
                            method: 'get',
                            params: null
                        }).then((res) => {
                            if (res.code === 0) {
                                let deviceVoss = res.data;
                                for (let i = 0; i < deviceVoss.length; i++) {
                                    newInfraredOn1(deviceVoss[i], status) ;
                                }
                            } else {
                                this.$message.error("查询失败！！");
                            }
                        });
                    }).catch(() => {
                        this.$message({type: 'info', message: '操作已取消'});
                    });
                }
            },
            newXindao() {
                this.$confirm("你确定要更改终端 " + this.deviceVo.stationId + "的信道吗？", "提示", {//确认框
                    type: 'warning'
                }).then(() => {
                    $axios({
                        url: "/resistance/operation/setSignalChannel/" + this.change_gatewayId,
                        method: 'post',
                        data: this.deviceVo
                    }).then((res) => {
                        if (res.code === 0) {
                            this.$message({ type: 'success', message: res.msg });
                            this.findPage();
                            this.operationFormVisible_NewDZY = false;
                        } else {
                            this.$message.error(res.msg);
                        }
                    });
                }).catch(() => {
                    this.$message({ type: 'info', message: '操作已取消' });
                });
            },
            handleGetWorkTimeNew(channelType) {
                $axios({
                    url: "/resistance/search/getWorkTime/" + channelType,
                    method: 'post',
                    data: this.deviceVo
                }).then((res) => {
                    if (res.code === 0) {
                        this.$message({ type: 'success', message: "获取工作时间成功！！" });
                        if(channelType == "28"){
                            this.startTime1 = new Date("2016-09-10T" + res.data.data.timeStart);
                            this.endTime1 = new Date("2016-09-10T" + res.data.data.timeEnd);
                        }else if(channelType == "2E"){
                            this.startTime2 = new Date("2016-09-10T" + res.data.data.timeStart);
                            this.endTime2 = new Date("2016-09-10T" + res.data.data.timeEnd);
                        }else{
                            this.startTime3 = new Date("2016-09-10T" + res.data.data.timeStart);
                            this.endTime3 = new Date("2016-09-10T" + res.data.data.timeEnd);
                        }
                    } else {
                        this.$message.error(res.msg);
                    }
                })
            },
            handleSetWorkTimeNew(channelType) {
                if (channelType== '28')
                {
                    if( this.startTime1 === null
                        || this.endTime1 === null
                        || this.endTime1 < this.startTime1
                    ){
                        this.$message({ type: 'error', message: '时间设置有误！！' });
                        return;
                    }
                }else if (channelType== '2E')
                {
                    if( this.startTime2 === null
                        || this.endTime2 === null
                        || this.endTime2 < this.startTime2
                    ){
                        this.$message({ type: 'error', message: '时间设置有误！！' });
                        return;
                    }
                }else{
                    if( this.startTime3 === null
                        || this.endTime3 === null
                        || this.endTime3 < this.startTime3
                    ){
                        this.$message({ type: 'error', message: '时间设置有误！！' });
                        return;
                    }
                }
                if (this.line_radio === "1") {
                    this.$confirm("你确定要设置终端 " + this.deviceVo.stationId + "的工作时间吗？", "提示", {//确认框
                        type: 'warning'
                    }).then(() => {
                        handleSetWorkTime2( channelType, this.deviceVo)
                    }).catch((e) => {
                        console.log(e);
                        this.$message({ type: 'info', message: '操作已取消' });
                    });
                } else {
                    this.$confirm("你确定要设置生产线 " + this.deviceVo.line + "所有" + this.deviceVo.deviceTypeName + "的工作时间吗？", "提示", {//确认框
                        type: 'warning'
                    }).then(() => {
                        $axios({
                            url: "/device/getByLineAndType?deviceType=" + this.deviceVo.deviceTypeName + "&lineName=" + this.deviceVo.line,
                            method: 'get',
                            params: null
                        }).then((res) => {
                            if (res.code === 0) {
                                let deviceVoss = res.data;
                                for (let i = 0; i < deviceVoss.length; i++) {
                                    handleSetWorkTime2(channelType , deviceVoss[i]);
                                }
                            } else {
                                this.$message.error("查询失败！！");
                            }
                        });
                    }).catch(() => {
                        this.$message({ type: 'info', message: '操作已取消' });
                    });
                }
            },
            // ================ 新版接地电阻仪 结束 =================
            showServer(item) {
                return item.gatewayName + "  信道:" + item.signalChannel + " Ip地址:" + item.serverIp;
            },
        },
        beforeDestroy() {
            window.clearInterval(this.setTimeClock);
            window.clearInterval(this.checkGatewayClock);
            window.clearInterval(this.pageDataClock);
        }
    });
</script>
</body>
</html>